package us.versus.them.stickler.graphics;

import flash.events.Event;

class FlashEventAdapter< T > {

	private var callBackMethods : Array< Dynamic >;
	private var adapter : Dynamic;

	public function new( adapter : Dynamic ) {
		callBackMethods = new Array();
		this.adapter = adapter;
	}

	public function add( callbacki : Dynamic ) {
		callBackMethods.push( callbacki );
	}

	public function call( event : T ) {
		for ( callBackMethod in callBackMethods ) {
			this.adapter( callBackMethod, event );
		}
	}
}
